module.exports = class EC
{
  static SUCESS = 200;
  static SUCESS_MSG = '操作成功';
  static FAILD = 400;
  static FAILD_MSG = '操作失败';
  static AUTH_ERR = 403;
  static AUTH_ERR_MSG = '授权错误';
  static NOT_FOUNT = 404;
  static NOT_FOUNT_MSG = '资源未找到';
  static PARAM_ERROR = 405;
  static PARAM_ERROR_MSG = '参数错误';
  static FETCH_DATA_ERROR = 406;
  static FETCH_DATA_ERROR_MSG = '获取数据失败';
  static PARSE_ERROR = 407;
  static PARSE_ERROR_MSG = '解析错误';
  static REQUEST_ERROR = 408;
  static REQUEST_ERROR_MSG = '请求错误';
  static NO_SUCH_USER = 409;
  static NO_SUCH_USER_MSG = '无此用户';

  // sql错误
  static ER_NO_SUCH_TABLE = 1146;
  static NO_SUCH_TABLE_MSG = '找不到数据表';
  static ER_NO_REFERENCED_ROW_2 = 1452; // 外键限制错误
  static NO_REFERENCED_ROW_2_MSG = '外键错误';
  static ER_DUP_ENTRY = 1062; // 唯一键重复
  static DUP_ENTRY = '唯一键重复';

  // 设备类
  static DEV_ALREADY_EXISTS = 10401
  static DEV_ALREADY_EXISTS_MSG = '设备已经存在'
  static DEV_TYPE_ERR = 10402
  static DEV_TYPE_ERR_MSG = '设备类型不匹配'
  static DEV_NON_EXISTENT = 10403
  static DEV_NON_EXISTENT_MSG = '设备不存在'
  static DEV_OWNER_NOT_YOU = 10404
  static DEV_OWNER_NOT_YOU_MSG = '对此设备无操作权限'

  // 权限类
  static NO_LEVEL_AUTH = 90401;
  static NO_LEVEL_AUTH_MSG = '权限级别受限';
  static NUM_LIMITED_ERR = 90402;
  static NUM_LIMITED_ERR_MSG = '超过允许的数量';





}

